// Implements Object.beget to use in place of Object.create
// because Object.create cannot be safely shimmed
// Object.beget has the same behaviour as call Object.create with a single non-null argument
if (!Object.beget) {
    Object.beget = function (prototype) {
        var object;
        if (prototype === null) {
            throw new TypeError("Prototype cannot be null");
        }
        if (typeof prototype != "object") {
            throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'");
        }
        var Type = function () {};
        Type.prototype = prototype;
        object = new Type();
        // IE has no built-in implementation of `Object.getPrototypeOf`
        // neither `__proto__`, but this manually setting `__proto__` will
        // guarantee that `Object.getPrototypeOf` will work as expected with
        // objects created using `Object.create`
        object.__proto__ = prototype;
        return object;
    };
}
